package com.xml;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

/**
 * 存储对象
 *
 * @author jiangbang
 * @date 2016/8/25
 */
public class PersonHandler extends DefaultHandler{

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
        System.out.println("开始一个元素" + qName);
    }

    @Override
    public void startDocument() throws SAXException {
        System.out.println("处理文档开始");
    }

    @Override
    public void endDocument() throws SAXException {
        System.out.println("处理文档结束");
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        System.out.println("结束一个元素"+ qName);

    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        super.characters(ch, start, length);
    }
}
